/**
   EMMA = Estación Metereológica de Muestreo Automática
 
 emma_project
 Copyright (C) 2015  Rodrigo Garcia

 This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/

#include "ProgMemLink.h"
#include "ProgMemStrings.h"

void Copy_STR_SensorsNamesTemperature1(char *buffer ,unsigned char index)
{
  strcpy_P(buffer, (PGM_P)pgm_read_word(&(STR_SensorsNamesTemperature1[index])));
}

void Copy_STR_SensorsNamesRelativeHumidity(char *buffer ,unsigned char index)
{
  strcpy_P(buffer, (PGM_P)pgm_read_word(&(STR_SensorsNamesRelativeHumidity[index])));
}

void Copy_STR_Physical_Phenomenon(char *buffer, unsigned char index)
{
  strcpy_P(buffer, (PGM_P)pgm_read_word(&(STR_Physical_Phenomenon[index])));
}

void Copy_STR_User_Serial_Interface(char *buffer, unsigned char index)
{
  strcpy_P(buffer, (PGM_P)pgm_read_word(&(STR_User_Serial_Interface[index])));
}

// Number of elements of string array (only works on arrays!)
unsigned char Nelements_STR_SensorsNamesTemperature1(void)
{
  return (sizeof(STR_SensorsNamesTemperature1)/sizeof(STR_SensorsNamesTemperature1[0]));
}

unsigned char Nelements_STR_SensorsNamesRelativeHumidity(void)
{
  return (sizeof(STR_SensorsNamesRelativeHumidity)/sizeof(STR_SensorsNamesRelativeHumidity[0]));
}

